/*
 * Copyright 2013 Agustina Martinez-Garcia

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
package uk.ljmu.fedoraifz.wadl.fedora34;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.List;
import javax.activation.DataSource;
import javax.xml.bind.JAXBContext;
//import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;

import org.apache.log4j.Category;
import org.apache.log4j.Logger;
import org.igfay.jfig.JFig;
import org.igfay.jfig.JFigException;
import org.jvnet.ws.wadl.util.DSDispatcher;
//import org.jvnet.ws.wadl.util.JAXBDispatcher;
import org.jvnet.ws.wadl.util.UriBuilder;

import uk.ljmu.fedoraifz.restrequests.UserCredentials;


/**
 * Class generated by using the wadl2java application from Java net WADL Specification
 * 
 * Manual intervention needed to fix the paths generated since they contain duplicated slashes and
 * path segments
 * 
 * Main differences between 3.4 and 3.3 are the inclusion of the Relationships Operations
 * not present in Fedora 3.3 REST API
 */
public class FedoraObjects34 {


    public static class Objects {

	private static Logger log = Logger.getLogger(FedoraObjects34.class);

	//private JAXBDispatcher _jaxbDispatcher;
	private DSDispatcher _dsDispatcher;
	private UriBuilder _uriBuilder;
	@SuppressWarnings("unused")
	private JAXBContext _jc;
	private HashMap<String, Object> _templateAndMatrixParameterValues;
	private DataSource retVal;

	private List<String> matrixParamSet;

	/**
	 * @param matrixParamSet the matrixParamSet to set
	 */
	public void setMatrixParamSet(List<String> matrixParamSet) {
	    this.matrixParamSet = matrixParamSet;
	}

	/**
	 * @return the matrixParamSet
	 */
	public List<String> getMatrixParamSet() {
	    return matrixParamSet;
	}

	public void setRetVal(DataSource retVal) {
	    this.retVal = retVal;
	}

	public DataSource getRetVal() {
	    return retVal;
	}

	/**
	 * Create new instance
	 * 
	 */
	public Objects()
	throws JAXBException
	{
	    _dsDispatcher = new DSDispatcher();
	    _uriBuilder = new UriBuilder();
	    String basePath;
	    try {
		basePath = JFig.getInstance().getValue("fedoraServer", "restService");
	    } catch (JFigException e) {
		log.fatal(e.getMessage());
		//Error, use default Fedora path
		basePath = "http://localhost:8080/fedora";
	    }
	    setMatrixParamSet(_uriBuilder.addPathSegment(basePath));
	    setMatrixParamSet(_uriBuilder.addPathSegment("/objects"));
	    _templateAndMatrixParameterValues = new HashMap<String, Object>();
	}

	public void get()
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	public void get(UserCredentials userCreds)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void getAsvoid()
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public void get(String terms, String query, Integer maxresults, String sessiontoken, String resultformat)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("terms", terms);
	    _queryParameterValues.put("query", query);
	    _queryParameterValues.put("maxResults", maxresults);
	    _queryParameterValues.put("sessionToken", sessiontoken);
	    _queryParameterValues.put("resultFormat", resultformat);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	public void get(UserCredentials userCreds, String terms, String query, Integer maxresults, String sessiontoken, String resultformat)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    // AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());
	    _queryParameterValues.put("terms", terms);
	    _queryParameterValues.put("query", query);
	    _queryParameterValues.put("maxResults", maxresults);
	    _queryParameterValues.put("sessionToken", sessiontoken);
	    _queryParameterValues.put("resultFormat", resultformat);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void getAsvoid(String terms, String query, Integer maxresults, String sessiontoken, String resultformat)
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("terms", terms);
	    _queryParameterValues.put("query", query);
	    _queryParameterValues.put("maxResults", maxresults);
	    _queryParameterValues.put("sessionToken", sessiontoken);
	    _queryParameterValues.put("resultFormat", resultformat);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public static class NextPID {

	    //private JAXBDispatcher _jaxbDispatcher;
	    private DSDispatcher _dsDispatcher;
	    private UriBuilder _uriBuilder;
	    @SuppressWarnings("unused")
	    private JAXBContext _jc;
	    private HashMap<String, Object> _templateAndMatrixParameterValues;
	    private List<String> matrixParamSet;
	    private DataSource retVal;

	    public void setMatrixParamSet(List<String> matrixParamSet) {
		this.matrixParamSet = matrixParamSet;
	    }

	    public List<String> getMatrixParamSet() {
		return matrixParamSet;
	    }

	    public void setRetVal(DataSource retVal) {
		this.retVal = retVal;
	    }

	    public DataSource getRetVal() {
		return retVal;
	    }

	    /**
	     * Create new instance
	     * 
	     */
	    public NextPID()
	    throws JAXBException
	    {
		_dsDispatcher = new DSDispatcher();
		_uriBuilder = new UriBuilder();
		String basePath;
		try {
		    basePath = JFig.getInstance().getValue("fedoraServer", "restService");
		} catch (JFigException e) {
		    log.fatal(e.getMessage());
		    // Error, use default Fedora path
		    basePath = "http://localhost:8080/fedora";
		}
		matrixParamSet = _uriBuilder.addPathSegment(basePath);
		matrixParamSet = _uriBuilder.addPathSegment("/objects");
		matrixParamSet = _uriBuilder.addPathSegment("nextPID");
		_templateAndMatrixParameterValues = new HashMap<String, Object>();
	    }

	    public void post()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    public void post(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    /* public void postAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void post(Integer numpids, String namespace, String format)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("numPIDs", numpids);
		_queryParameterValues.put("namespace", namespace);
		_queryParameterValues.put("format", format);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    public void post(UserCredentials userCreds, Integer numpids, String namespace, String format)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());
		_queryParameterValues.put("numPIDs", numpids);
		_queryParameterValues.put("namespace", namespace);
		_queryParameterValues.put("format", format);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    /*public void postAsvoid(Integer numpids, String namespace, String format)
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("numPIDs", numpids);
		_queryParameterValues.put("namespace", namespace);
		_queryParameterValues.put("format", format);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/
	}

    }

    public static class Pid {

	//private JAXBDispatcher _jaxbDispatcher;
	private DSDispatcher _dsDispatcher;
	private UriBuilder _uriBuilder;
	@SuppressWarnings("unused")
	private JAXBContext _jc;
	private HashMap<String, Object> _templateAndMatrixParameterValues;
	private List<String> matrixParamSet;
	private DataSource retVal;
	private static Category log;

	/**
	 * Create new instance
	 * 
	 */
	public Pid(String pid)
	throws JAXBException
	{
	    _dsDispatcher = new DSDispatcher();
	    _uriBuilder = new UriBuilder();
	    String basePath;
	    try {
		basePath = JFig.getInstance().getValue("fedoraServer", "restService");
	    } catch (JFigException e) {
		log.fatal(e.getMessage());
		// Error, use default Fedora path
		basePath = "http://localhost:8080/fedora";
	    }
	    matrixParamSet = _uriBuilder.addPathSegment(basePath);
	    matrixParamSet = _uriBuilder.addPathSegment("/{pid}");
	    _templateAndMatrixParameterValues = new HashMap<String, Object>();
	    _templateAndMatrixParameterValues.put("pid", pid);
	}

	/**
	 * Get pid
	 * 
	 */
	public String getPid() {
	    return ((String) _templateAndMatrixParameterValues.get("pid"));
	}

	public void setMatrixParamSet(List<String> matrixParamSet) {
	    this.matrixParamSet = matrixParamSet;
	}

	public List<String> getMatrixParamSet() {
	    return matrixParamSet;
	}

	public void setRetVal(DataSource retVal) {
	    this.retVal = retVal;
	}

	public DataSource getRetVal() {
	    return retVal;
	}

	/**
	 * Set pid
	 * 
	 */
	public void setPid(String pid) {
	    _templateAndMatrixParameterValues.put("pid", pid);
	}

	public void post()
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
	    return ;
	}

	public void post(UserCredentials userCreds)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
	    return ;
	}

	/*public void postAsvoid()
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public void post(String label, String logmessage, String format, String encoding, String namespace, String ownerid, String state, Boolean ignoremime)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("label", label);
	    _queryParameterValues.put("logMessage", logmessage);
	    _queryParameterValues.put("format", format);
	    _queryParameterValues.put("encoding", encoding);
	    _queryParameterValues.put("namespace", namespace);
	    _queryParameterValues.put("ownerId", ownerid);
	    _queryParameterValues.put("state", state);
	    _queryParameterValues.put("ignoreMime", ignoremime);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
	    return ;
	}

	public void post(UserCredentials userCreds, String label, String logmessage, String format, String encoding, String namespace, String ownerid, String state, Boolean ignoremime)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    _queryParameterValues.put("label", label);
	    _queryParameterValues.put("logMessage", logmessage);
	    _queryParameterValues.put("format", format);
	    _queryParameterValues.put("encoding", encoding);
	    _queryParameterValues.put("namespace", namespace);
	    _queryParameterValues.put("ownerId", ownerid);
	    _queryParameterValues.put("state", state);
	    _queryParameterValues.put("ignoreMime", ignoremime);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
	    return ;
	}

	/*public void postAsvoid(String label, String logmessage, String format, String encoding, String namespace, String ownerid, String state, Boolean ignoremime)
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("label", label);
	    _queryParameterValues.put("logMessage", logmessage);
	    _queryParameterValues.put("format", format);
	    _queryParameterValues.put("encoding", encoding);
	    _queryParameterValues.put("namespace", namespace);
	    _queryParameterValues.put("ownerId", ownerid);
	    _queryParameterValues.put("state", state);
	    _queryParameterValues.put("ignoreMime", ignoremime);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public void get()
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	public void get(UserCredentials userCreds)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void getAsvoid()
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public void get(String asofdatetime, String format)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("asOfDateTime", asofdatetime);
	    _queryParameterValues.put("format", format);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	public void get(UserCredentials userCreds, String asofdatetime, String format)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    _queryParameterValues.put("asOfDateTime", asofdatetime);
	    _queryParameterValues.put("format", format);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void getAsvoid(String asofdatetime, String format)
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("asOfDateTime", asofdatetime);
	    _queryParameterValues.put("format", format);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public void delete()
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doDELETE(_url, _headerParameterValues, null);
	    return ;
	}

	public void delete(UserCredentials userCreds)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doDELETE(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void deleteAsvoid()
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doDELETE(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public void delete(String logmessage)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("logMessage", logmessage);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doDELETE(_url, _headerParameterValues, null);
	    return ;
	}

	public void delete(UserCredentials userCreds, String logmessage)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    _queryParameterValues.put("logMessage", logmessage);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doDELETE(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void deleteAsvoid(String logmessage)
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("logMessage", logmessage);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doDELETE(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public void put()
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doPUT(null, null, _url, _headerParameterValues, null);
	    return ;
	}

	public void put(UserCredentials userCreds)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doPUT(null, null, _url, _headerParameterValues, null);
	    return ;
	}

	/*public void putAsvoid()
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doPUT(null, null, _url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public void put(String label, String logmessage, String ownerid, String state, String lastmodifieddate)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("label", label);
	    _queryParameterValues.put("logMessage", logmessage);
	    _queryParameterValues.put("ownerId", ownerid);
	    _queryParameterValues.put("state", state);
	    _queryParameterValues.put("lastModifiedDate", lastmodifieddate);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doPUT(null, null, _url, _headerParameterValues, null);
	    return ;
	}

	public void put(UserCredentials userCreds, String label, String logmessage, String ownerid, String state, String lastmodifieddate)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    _queryParameterValues.put("label", label);
	    _queryParameterValues.put("logMessage", logmessage);
	    _queryParameterValues.put("ownerId", ownerid);
	    _queryParameterValues.put("state", state);
	    _queryParameterValues.put("lastModifiedDate", lastmodifieddate);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doPUT(null, null, _url, _headerParameterValues, null);
	    return ;
	}

	/*public void putAsvoid(String label, String logmessage, String ownerid, String state, String lastmodifieddate)
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("label", label);
	    _queryParameterValues.put("logMessage", logmessage);
	    _queryParameterValues.put("ownerId", ownerid);
	    _queryParameterValues.put("state", state);
	    _queryParameterValues.put("lastModifiedDate", lastmodifieddate);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doPUT(null, null, _url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public static class Export {

	    //private JAXBDispatcher _jaxbDispatcher;
	    private DSDispatcher _dsDispatcher;
	    private UriBuilder _uriBuilder;
	    @SuppressWarnings("unused")
	    private JAXBContext _jc;
	    private HashMap<String, Object> _templateAndMatrixParameterValues;
	    private List<String> matrixParamSet;
	    private DataSource retVal;

	    /**
	     * Create new instance
	     * 
	     */
	    public Export(String pid)
	    throws JAXBException
	    {
		_dsDispatcher = new DSDispatcher();
		_uriBuilder = new UriBuilder();
		String basePath;
		try {
		    basePath = JFig.getInstance().getValue("fedoraServer", "restService");
		} catch (JFigException e) {
		    log.fatal(e.getMessage());
		    // Error, use default Fedora path
		    basePath = "http://localhost:8080/fedora";
		}
		matrixParamSet = _uriBuilder.addPathSegment(basePath);
		matrixParamSet = _uriBuilder.addPathSegment("/{pid}");
		matrixParamSet = _uriBuilder.addPathSegment("/export");
		_templateAndMatrixParameterValues = new HashMap<String, Object>();
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    public void setMatrixParamSet(List<String> matrixParamSet) {
		this.matrixParamSet = matrixParamSet;
	    }

	    public List<String> getMatrixParamSet() {
		return matrixParamSet;
	    }

	    public void setRetVal(DataSource retVal) {
		this.retVal = retVal;
	    }

	    public DataSource getRetVal() {
		return retVal;
	    }

	    /**
	     * Get pid
	     * 
	     */
	    public String getPid() {
		return ((String) _templateAndMatrixParameterValues.get("pid"));
	    }

	    /**
	     * Set pid
	     * 
	     */
	    public void setPid(String pid) {
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    public void get()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /* public void getAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void get(String format, String context, String encoding)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("format", format);
		_queryParameterValues.put("context", context);
		_queryParameterValues.put("encoding", encoding);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds, String format, String context, String encoding)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		_queryParameterValues.put("format", format);
		_queryParameterValues.put("context", context);
		_queryParameterValues.put("encoding", encoding);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /*  public void getAsvoid(String format, String context, String encoding)
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("format", format);
		_queryParameterValues.put("context", context);
		_queryParameterValues.put("encoding", encoding);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	}

	public static class ObjectXML {

	    //private JAXBDispatcher _jaxbDispatcher;
	    private DSDispatcher _dsDispatcher;
	    private UriBuilder _uriBuilder;
	    @SuppressWarnings("unused")
	    private JAXBContext _jc;
	    private HashMap<String, Object> _templateAndMatrixParameterValues;
	    private List<String> matrixParamSet;
	    private DataSource retVal;

	    public void setRetVal(DataSource retVal) {
		this.retVal = retVal;
	    }

	    public DataSource getRetVal() {
		return retVal;
	    }

	    /**
	     * Create new instance
	     * 
	     */
	    public ObjectXML(String pid)
	    throws JAXBException
	    {
		_dsDispatcher = new DSDispatcher();
		_uriBuilder = new UriBuilder();
		String basePath;
		try {
		    basePath = JFig.getInstance().getValue("fedoraServer", "restService");
		} catch (JFigException e) {
		    log.fatal(e.getMessage());
		    // Error, use default Fedora path
		    basePath = "http://localhost:8080/fedora";
		}
		matrixParamSet = _uriBuilder.addPathSegment(basePath);
		matrixParamSet = _uriBuilder.addPathSegment("/{pid}");
		matrixParamSet = _uriBuilder.addPathSegment("/objectXML");
		_templateAndMatrixParameterValues = new HashMap<String, Object>();
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    public void setMatrixParamSet(List<String> matrixParamSet) {
		this.matrixParamSet = matrixParamSet;
	    }

	    public List<String> getMatrixParamSet() {
		return matrixParamSet;
	    }

	    /**
	     * Get pid
	     * 
	     */
	    public String getPid() {
		return ((String) _templateAndMatrixParameterValues.get("pid"));
	    }

	    /**
	     * Set pid
	     * 
	     */
	    public void setPid(String pid) {
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    public void get()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /*  public void getAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	}

	public static class Validate {

	    //private JAXBDispatcher _jaxbDispatcher;
	    private DSDispatcher _dsDispatcher;
	    private UriBuilder _uriBuilder;
	    @SuppressWarnings("unused")
	    private JAXBContext _jc;
	    private HashMap<String, Object> _templateAndMatrixParameterValues;
	    private List<String> matrixParamSet;
	    private DataSource retVal;

	    public void setMatrixParamSet(List<String> matrixParamSet) {
		this.matrixParamSet = matrixParamSet;
	    }

	    public List<String> getMatrixParamSet() {
		return matrixParamSet;
	    }

	    public void setRetVal(DataSource retVal) {
		this.retVal = retVal;
	    }

	    public DataSource getRetVal() {
		return retVal;
	    }

	    /**
	     * Create new instance
	     * 
	     */
	    public Validate(String pid)
	    throws JAXBException
	    {
		_dsDispatcher = new DSDispatcher();
		_uriBuilder = new UriBuilder();
		String basePath;
		try {
		    basePath = JFig.getInstance().getValue("fedoraServer", "restService");
		} catch (JFigException e) {
		    log.fatal(e.getMessage());
		    //Error, use default Fedora path
		    basePath = "http://localhost:8080/fedora";
		}
		matrixParamSet = _uriBuilder.addPathSegment(basePath);
		matrixParamSet = _uriBuilder.addPathSegment("/{pid}");
		matrixParamSet = _uriBuilder.addPathSegment("/validate");
		_templateAndMatrixParameterValues = new HashMap<String, Object>();
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    /**
	     * Get pid
	     * 
	     */
	    public String getPid() {
		return ((String) _templateAndMatrixParameterValues.get("pid"));
	    }

	    /**
	     * Set pid
	     * 
	     */
	    public void setPid(String pid) {
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    public void get()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /*public void getAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void get(UserCredentials userCreds, String asofdatetime)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		_queryParameterValues.put("asOfDateTime", asofdatetime);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(String asofdatetime)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("asOfDateTime", asofdatetime);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /*public void getAsvoid(String asofdatetime)
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("asOfDateTime", asofdatetime);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	}

	public static class Versions {

	    //private JAXBDispatcher _jaxbDispatcher;
	    private DSDispatcher _dsDispatcher;
	    private UriBuilder _uriBuilder;
	    @SuppressWarnings("unused")
	    private JAXBContext _jc;
	    private HashMap<String, Object> _templateAndMatrixParameterValues;
	    private List<String> matrixParamSet;
	    private DataSource retVal;

	    public void setMatrixParamSet(List<String> matrixParamSet) {
		this.matrixParamSet = matrixParamSet;
	    }

	    public List<String> getMatrixParamSet() {
		return matrixParamSet;
	    }

	    public void setRetVal(DataSource retVal) {
		this.retVal = retVal;
	    }

	    public DataSource getRetVal() {
		return retVal;
	    }

	    /**
	     * Create new instance
	     * 
	     */
	    public Versions(String pid)
	    throws JAXBException
	    {
		_dsDispatcher = new DSDispatcher();
		_uriBuilder = new UriBuilder();
		String basePath;
		try {
		    basePath = JFig.getInstance().getValue("fedoraServer", "restService");
		} catch (JFigException e) {
		    log.fatal(e.getMessage());
		    //Error, use default Fedora path
		    basePath = "http://localhost:8080/fedora";
		}
		matrixParamSet = _uriBuilder.addPathSegment(basePath);
		matrixParamSet = _uriBuilder.addPathSegment("/{pid}");
		matrixParamSet = _uriBuilder.addPathSegment("/versions");
		_templateAndMatrixParameterValues = new HashMap<String, Object>();
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    /**
	     * Get pid
	     * 
	     */
	    public String getPid() {
		return ((String) _templateAndMatrixParameterValues.get("pid"));
	    }

	    /**
	     * Set pid
	     * 
	     */
	    public void setPid(String pid) {
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    public void get()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /* public void getAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void get(String format)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("format", format);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds, String format)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		_queryParameterValues.put("format", format);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /*public void getAsvoid(String format)
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("format", format);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/
	}

    }

    public static class PidDatastreams {

	//private JAXBDispatcher _jaxbDispatcher;
	private DSDispatcher _dsDispatcher;
	private UriBuilder _uriBuilder;
	@SuppressWarnings("unused")
	private JAXBContext _jc;
	private HashMap<String, Object> _templateAndMatrixParameterValues;
	private List<String> matrixParamSet;
	private DataSource retVal;
	private static Logger log = Logger.getLogger(PidDatastreams.class);

	public void setMatrixParamSet(List<String> matrixParamSet) {
	    this.matrixParamSet = matrixParamSet;
	}

	public List<String> getMatrixParamSet() {
	    return matrixParamSet;
	}

	public void setRetVal(DataSource retVal) {
	    this.retVal = retVal;
	}

	public DataSource getRetVal() {
	    return retVal;
	}

	/**
	 * Create new instance
	 * 
	 */
	public PidDatastreams(String pid)
	throws JAXBException
	{
	    _dsDispatcher = new DSDispatcher();
	    _uriBuilder = new UriBuilder();
	    String basePath;
	    try {
		basePath = JFig.getInstance().getValue("fedoraServer", "restService");
	    } catch (JFigException e) {
		log .fatal(e.getMessage());
		//Error, use default Fedora path
		basePath = "http://localhost:8080/fedora";
	    }
	    matrixParamSet = _uriBuilder.addPathSegment(basePath);
	    matrixParamSet = _uriBuilder.addPathSegment("/{pid}/datastreams");
	    _templateAndMatrixParameterValues = new HashMap<String, Object>();
	    _templateAndMatrixParameterValues.put("pid", pid);
	}

	/**
	 * Get pid
	 * 
	 */
	public String getPid() {
	    return ((String) _templateAndMatrixParameterValues.get("pid"));
	}

	/**
	 * Set pid
	 * 
	 */
	public void setPid(String pid) {
	    _templateAndMatrixParameterValues.put("pid", pid);
	}

	public void get()
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	public void get(UserCredentials userCreds)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void getAsvoid()
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public void get(String asofdatetime, String format)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("asOfDateTime", asofdatetime);
	    _queryParameterValues.put("format", format);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	public void get(UserCredentials userCreds, String asofdatetime, String format)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    _queryParameterValues.put("asOfDateTime", asofdatetime);
	    _queryParameterValues.put("format", format);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void getAsvoid(String asofdatetime, String format)
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("asOfDateTime", asofdatetime);
	    _queryParameterValues.put("format", format);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public static class DsID {

	    // private JAXBDispatcher _jaxbDispatcher;
	    private DSDispatcher _dsDispatcher;
	    private UriBuilder _uriBuilder;
	    @SuppressWarnings("unused")
	    private JAXBContext _jc;
	    private HashMap<String, Object> _templateAndMatrixParameterValues;
	    private List<String> matrixParamSet;
	    private DataSource retVal;

	    public void setMatrixParamSet(List<String> matrixParamSet) {
		this.matrixParamSet = matrixParamSet;
	    }

	    public List<String> getMatrixParamSet() {
		return matrixParamSet;
	    }

	    public void setRetVal(DataSource retVal) {
		this.retVal = retVal;
	    }

	    public DataSource getRetVal() {
		return retVal;
	    }

	    /**
	     * Create new instance
	     * 
	     */
	    public DsID(String pid, String dsid)
	    throws JAXBException
	    {
		_dsDispatcher = new DSDispatcher();
		_uriBuilder = new UriBuilder();
		String basePath;
		try {
		    basePath = JFig.getInstance().getValue("fedoraServer", "restService");
		} catch (JFigException e) {
		    log.fatal(e.getMessage());
		    //Error, use default Fedora path
		    basePath = "http://localhost:8080/fedora";
		}
		matrixParamSet = _uriBuilder.addPathSegment(basePath);		
		matrixParamSet = _uriBuilder.addPathSegment("/{pid}/datastreams");
		matrixParamSet = _uriBuilder.addPathSegment("/{dsID}");
		_templateAndMatrixParameterValues = new HashMap<String, Object>();
		_templateAndMatrixParameterValues.put("pid", pid);
		_templateAndMatrixParameterValues.put("dsID", dsid);
	    }

	    /**
	     * Get pid
	     * 
	     */
	    public String getPid() {
		return ((String) _templateAndMatrixParameterValues.get("pid"));
	    }

	    /**
	     * Set pid
	     * 
	     */
	    public void setPid(String pid) {
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    /**
	     * Get dsID
	     * 
	     */
	    public String getDsid() {
		return ((String) _templateAndMatrixParameterValues.get("dsID"));
	    }

	    /**
	     * Set dsID
	     * 
	     */
	    public void setDsid(String dsid) {
		_templateAndMatrixParameterValues.put("dsID", dsid);
	    }

	    public void post()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    public void post(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    /* public void postAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void post(String controlgroup, String dslocation, String altids, String dslabel, Boolean versionable, String dsstate, String formaturi, String checksumtype, String checksum, String mimetype, String logmessage)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("controlGroup", controlgroup);
		_queryParameterValues.put("dsLocation", dslocation);
		_queryParameterValues.put("altIDs", altids);
		_queryParameterValues.put("dsLabel", dslabel);
		_queryParameterValues.put("versionable", versionable);
		_queryParameterValues.put("dsState", dsstate);
		_queryParameterValues.put("formatURI", formaturi);
		_queryParameterValues.put("checksumType", checksumtype);
		_queryParameterValues.put("checksum", checksum);
		_queryParameterValues.put("mimeType", mimetype);
		_queryParameterValues.put("logMessage", logmessage);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    public void post(UserCredentials userCreds, String controlgroup, String dslocation, String altids, String dslabel, Boolean versionable, String dsstate, String formaturi, String checksumtype, String checksum, String mimetype, String logmessage)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		_queryParameterValues.put("controlGroup", controlgroup);
		_queryParameterValues.put("dsLocation", dslocation);
		_queryParameterValues.put("altIDs", altids);
		_queryParameterValues.put("dsLabel", dslabel);
		_queryParameterValues.put("versionable", versionable);
		_queryParameterValues.put("dsState", dsstate);
		_queryParameterValues.put("formatURI", formaturi);
		_queryParameterValues.put("checksumType", checksumtype);
		_queryParameterValues.put("checksum", checksum);
		_queryParameterValues.put("mimeType", mimetype);
		_queryParameterValues.put("logMessage", logmessage);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    /* public void postAsvoid(String controlgroup, String dslocation, String altids, String dslabel, Boolean versionable, String dsstate, String formaturi, String checksumtype, String checksum, String mimetype, String logmessage)
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("controlGroup", controlgroup);
		_queryParameterValues.put("dsLocation", dslocation);
		_queryParameterValues.put("altIDs", altids);
		_queryParameterValues.put("dsLabel", dslabel);
		_queryParameterValues.put("versionable", versionable);
		_queryParameterValues.put("dsState", dsstate);
		_queryParameterValues.put("formatURI", formaturi);
		_queryParameterValues.put("checksumType", checksumtype);
		_queryParameterValues.put("checksum", checksum);
		_queryParameterValues.put("mimeType", mimetype);
		_queryParameterValues.put("logMessage", logmessage);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void put()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPUT(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    public void put(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPUT(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    /*  public void putAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doPUT(null, null, _url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void put(String dslocation, String altids, String dslabel, Boolean versionable, String dsstate, String formaturi, String checksumtype, String checksum, String mimetype, String logmessage, Boolean ignorecontent, String lastmodifieddate)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("dsLocation", dslocation);
		_queryParameterValues.put("altIDs", altids);
		_queryParameterValues.put("dsLabel", dslabel);
		_queryParameterValues.put("versionable", versionable);
		_queryParameterValues.put("dsState", dsstate);
		_queryParameterValues.put("formatURI", formaturi);
		_queryParameterValues.put("checksumType", checksumtype);
		_queryParameterValues.put("checksum", checksum);
		_queryParameterValues.put("mimeType", mimetype);
		_queryParameterValues.put("logMessage", logmessage);
		_queryParameterValues.put("ignoreContent", ignorecontent);
		_queryParameterValues.put("lastModifiedDate", lastmodifieddate);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPUT(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    public void put(UserCredentials userCreds, String dslocation, String altids, String dslabel, Boolean versionable, String dsstate, String formaturi, String checksumtype, String checksum, String mimetype, String logmessage, Boolean ignorecontent, String lastmodifieddate)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		_queryParameterValues.put("dsLocation", dslocation);
		_queryParameterValues.put("altIDs", altids);
		_queryParameterValues.put("dsLabel", dslabel);
		_queryParameterValues.put("versionable", versionable);
		_queryParameterValues.put("dsState", dsstate);
		_queryParameterValues.put("formatURI", formaturi);
		_queryParameterValues.put("checksumType", checksumtype);
		_queryParameterValues.put("checksum", checksum);
		_queryParameterValues.put("mimeType", mimetype);
		_queryParameterValues.put("logMessage", logmessage);
		_queryParameterValues.put("ignoreContent", ignorecontent);
		_queryParameterValues.put("lastModifiedDate", lastmodifieddate);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPUT(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    /* public void putAsvoid(String dslocation, String altids, String dslabel, Boolean versionable, String dsstate, String formaturi, String checksumtype, String checksum, String mimetype, String logmessage, Boolean ignorecontent, String lastmodifieddate)
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("dsLocation", dslocation);
		_queryParameterValues.put("altIDs", altids);
		_queryParameterValues.put("dsLabel", dslabel);
		_queryParameterValues.put("versionable", versionable);
		_queryParameterValues.put("dsState", dsstate);
		_queryParameterValues.put("formatURI", formaturi);
		_queryParameterValues.put("checksumType", checksumtype);
		_queryParameterValues.put("checksum", checksum);
		_queryParameterValues.put("mimeType", mimetype);
		_queryParameterValues.put("logMessage", logmessage);
		_queryParameterValues.put("ignoreContent", ignorecontent);
		_queryParameterValues.put("lastModifiedDate", lastmodifieddate);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doPUT(null, null, _url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void delete()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doDELETE(_url, _headerParameterValues, null);
		return ;
	    }

	    public void delete(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doDELETE(_url, _headerParameterValues, null);
		return ;
	    }

	    /* public void deleteAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doDELETE(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void delete(String startdt, String enddt, String logmessage)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("startDT", startdt);
		_queryParameterValues.put("endDT", enddt);
		_queryParameterValues.put("logMessage", logmessage);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doDELETE(_url, _headerParameterValues, null);
		return ;
	    }

	    public void delete(UserCredentials userCreds, String startdt, String enddt, String logmessage)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		_queryParameterValues.put("startDT", startdt);
		_queryParameterValues.put("endDT", enddt);
		_queryParameterValues.put("logMessage", logmessage);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doDELETE(_url, _headerParameterValues, null);
		return ;
	    }

	    /* public void deleteAsvoid(String startdt, String enddt, String logmessage)
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("startDT", startdt);
		_queryParameterValues.put("endDT", enddt);
		_queryParameterValues.put("logMessage", logmessage);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doDELETE(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void get()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /*public void getAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void get(String asofdatetime, String format, Boolean validatechecksum)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("asOfDateTime", asofdatetime);
		_queryParameterValues.put("format", format);
		_queryParameterValues.put("validateChecksum", validatechecksum);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds, String asofdatetime, String format, Boolean validatechecksum)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		_queryParameterValues.put("asOfDateTime", asofdatetime);
		_queryParameterValues.put("format", format);
		_queryParameterValues.put("validateChecksum", validatechecksum);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /*public void getAsvoid(String asofdatetime, String format, Boolean validatechecksum)
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("asOfDateTime", asofdatetime);
		_queryParameterValues.put("format", format);
		_queryParameterValues.put("validateChecksum", validatechecksum);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	}

	public static class DsIDContent {

	    // private JAXBDispatcher _jaxbDispatcher;
	    private DSDispatcher _dsDispatcher;
	    private UriBuilder _uriBuilder;
	    @SuppressWarnings("unused")
	    private JAXBContext _jc;
	    private HashMap<String, Object> _templateAndMatrixParameterValues;
	    private List<String> matrixParamSet;
	    private DataSource retVal;

	    public void setMatrixParamSet(List<String> matrixParamSet) {
		this.matrixParamSet = matrixParamSet;
	    }

	    public List<String> getMatrixParamSet() {
		return matrixParamSet;
	    }

	    public void setRetVal(DataSource retVal) {
		this.retVal = retVal;
	    }

	    public DataSource getRetVal() {
		return retVal;
	    }

	    /**
	     * Create new instance
	     * 
	     */
	    public DsIDContent(String pid, String dsid)
	    throws JAXBException
	    {
		_dsDispatcher = new DSDispatcher();
		_uriBuilder = new UriBuilder();
		String basePath;
		try {
		    basePath = JFig.getInstance().getValue("fedoraServer", "restService");
		} catch (JFigException e) {
		    log.fatal(e.getMessage());
		    //Error, use default Fedora path
		    basePath = "http://localhost:8080/fedora";
		}
		matrixParamSet = _uriBuilder.addPathSegment(basePath);
		matrixParamSet = _uriBuilder.addPathSegment("/{pid}/datastreams");
		matrixParamSet = _uriBuilder.addPathSegment("/{dsID}/content");
		_templateAndMatrixParameterValues = new HashMap<String, Object>();
		_templateAndMatrixParameterValues.put("pid", pid);
		_templateAndMatrixParameterValues.put("dsID", dsid);
	    }

	    /**
	     * Get pid
	     * 
	     */
	    public String getPid() {
		return ((String) _templateAndMatrixParameterValues.get("pid"));
	    }

	    /**
	     * Set pid
	     * 
	     */
	    public void setPid(String pid) {
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    /**
	     * Get dsID
	     * 
	     */
	    public String getDsid() {
		return ((String) _templateAndMatrixParameterValues.get("dsID"));
	    }

	    /**
	     * Set dsID
	     * 
	     */
	    public void setDsid(String dsid) {
		_templateAndMatrixParameterValues.put("dsID", dsid);
	    }

	    public void get()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /* public void getAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void get(String asofdatetime, String download)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("asOfDateTime", asofdatetime);
		_queryParameterValues.put("download", download);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds, String asofdatetime, String download)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		_queryParameterValues.put("asOfDateTime", asofdatetime);
		_queryParameterValues.put("download", download);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /*public void getAsvoid(String asofdatetime, String download)
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("asOfDateTime", asofdatetime);
		_queryParameterValues.put("download", download);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }
	     */
	}

	public static class DsIDHistory {

	    //private JAXBDispatcher _jaxbDispatcher;
	    private DSDispatcher _dsDispatcher;
	    private UriBuilder _uriBuilder;
	    @SuppressWarnings("unused")
	    private JAXBContext _jc;
	    private HashMap<String, Object> _templateAndMatrixParameterValues;
	    private List<String> matrixParamSet;
	    private DataSource retVal;

	    public void setMatrixParamSet(List<String> matrixParamSet) {
		this.matrixParamSet = matrixParamSet;
	    }

	    public List<String> getMatrixParamSet() {
		return matrixParamSet;
	    }

	    public void setRetVal(DataSource retVal) {
		this.retVal = retVal;
	    }

	    public DataSource getRetVal() {
		return retVal;
	    }

	    /**
	     * Create new instance
	     * 
	     */
	    public DsIDHistory(String pid, String dsid)
	    throws JAXBException
	    {
		_dsDispatcher = new DSDispatcher();
		_uriBuilder = new UriBuilder();
		String basePath;
		try {
		    basePath = JFig.getInstance().getValue("fedoraServer", "restService");
		} catch (JFigException e) {
		    log.fatal(e.getMessage());
		    //Error, use default Fedora path
		    basePath = "http://localhost:8080/fedora";
		}
		matrixParamSet = _uriBuilder.addPathSegment(basePath);
		matrixParamSet = _uriBuilder.addPathSegment("/{pid}/datastreams");
		matrixParamSet = _uriBuilder.addPathSegment("/{dsID}/history");
		_templateAndMatrixParameterValues = new HashMap<String, Object>();
		_templateAndMatrixParameterValues.put("pid", pid);
		_templateAndMatrixParameterValues.put("dsID", dsid);
	    }

	    /**
	     * Get pid
	     * 
	     */
	    public String getPid() {
		return ((String) _templateAndMatrixParameterValues.get("pid"));
	    }

	    /**
	     * Set pid
	     * 
	     */
	    public void setPid(String pid) {
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    /**
	     * Get dsID
	     * 
	     */
	    public String getDsid() {
		return ((String) _templateAndMatrixParameterValues.get("dsID"));
	    }

	    /**
	     * Set dsID
	     * 
	     */
	    public void setDsid(String dsid) {
		_templateAndMatrixParameterValues.put("dsID", dsid);
	    }

	    public void get()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /* public void getAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void get(UserCredentials userCreds, String format)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		_queryParameterValues.put("format", format);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(String format)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("format", format);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /* public void getAsvoid(String format)
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("format", format);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	}

    }

    public static class PidMethods {

	//private JAXBDispatcher _jaxbDispatcher;
	private DSDispatcher _dsDispatcher;
	private UriBuilder _uriBuilder;
	@SuppressWarnings("unused")
	private JAXBContext _jc;
	private HashMap<String, Object> _templateAndMatrixParameterValues;
	private List<String> matrixParamSet;
	private DataSource retVal;
	private static Logger log = Logger.getLogger(PidMethods.class);

	public void setMatrixParamSet(List<String> matrixParamSet) {
	    this.matrixParamSet = matrixParamSet;
	}

	public List<String> getMatrixParamSet() {
	    return matrixParamSet;
	}

	public void setRetVal(DataSource retVal) {
	    this.retVal = retVal;
	}

	public DataSource getRetVal() {
	    return retVal;
	}

	/**
	 * Create new instance
	 * 
	 */
	public PidMethods(String pid)
	throws JAXBException
	{
	    _dsDispatcher = new DSDispatcher();
	    _uriBuilder = new UriBuilder();
	    String basePath;
	    try {
		basePath = JFig.getInstance().getValue("fedoraServer", "restService");
	    } catch (JFigException e) {
		log.fatal(e.getMessage());
		//Error, use default Fedora path
		basePath = "http://localhost:8080/fedora";
	    }
	    matrixParamSet = _uriBuilder.addPathSegment(basePath);
	    matrixParamSet = _uriBuilder.addPathSegment("/{pid}/methods");
	    _templateAndMatrixParameterValues = new HashMap<String, Object>();
	    _templateAndMatrixParameterValues.put("pid", pid);
	}

	/**
	 * Get pid
	 * 
	 */
	public String getPid() {
	    return ((String) _templateAndMatrixParameterValues.get("pid"));
	}

	/**
	 * Set pid
	 * 
	 */
	public void setPid(String pid) {
	    _templateAndMatrixParameterValues.put("pid", pid);
	}

	public void get()
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	public void get(UserCredentials userCreds)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void getAsvoid()
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public void get(UserCredentials userCreds, String asofdatetime, String format)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    _queryParameterValues.put("asOfDateTime", asofdatetime);
	    _queryParameterValues.put("format", format);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	public void get(String asofdatetime, String format)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("asOfDateTime", asofdatetime);
	    _queryParameterValues.put("format", format);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void getAsvoid(String asofdatetime, String format)
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("asOfDateTime", asofdatetime);
	    _queryParameterValues.put("format", format);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public static class SDef {

	    //private JAXBDispatcher _jaxbDispatcher;
	    private DSDispatcher _dsDispatcher;
	    private UriBuilder _uriBuilder;
	    @SuppressWarnings("unused")
	    private JAXBContext _jc;
	    private HashMap<String, Object> _templateAndMatrixParameterValues;
	    private List<String> matrixParamSet;
	    private DataSource retVal;

	    public void setMatrixParamSet(List<String> matrixParamSet) {
		this.matrixParamSet = matrixParamSet;
	    }

	    public List<String> getMatrixParamSet() {
		return matrixParamSet;
	    }

	    public void setRetVal(DataSource retVal) {
		this.retVal = retVal;
	    }

	    public DataSource getRetVal() {
		return retVal;
	    }

	    /**
	     * Create new instance
	     * 
	     */
	    public SDef(String pid, String sdef)
	    throws JAXBException
	    {
		_dsDispatcher = new DSDispatcher();
		_uriBuilder = new UriBuilder();
		String basePath;
		try {
		    basePath = JFig.getInstance().getValue("fedoraServer", "restService");
		} catch (JFigException e) {
		    log .fatal(e.getMessage());
		    //Error, use default Fedora path
		    basePath = "http://localhost:8080/fedora";
		}
		matrixParamSet = _uriBuilder.addPathSegment(basePath);
		matrixParamSet = _uriBuilder.addPathSegment("/{pid}/methods");
		matrixParamSet = _uriBuilder.addPathSegment("/{sDef}");
		_templateAndMatrixParameterValues = new HashMap<String, Object>();
		_templateAndMatrixParameterValues.put("pid", pid);
		_templateAndMatrixParameterValues.put("sDef", sdef);
	    }

	    /**
	     * Get pid
	     * 
	     */
	    public String getPid() {
		return ((String) _templateAndMatrixParameterValues.get("pid"));
	    }

	    /**
	     * Set pid
	     * 
	     */
	    public void setPid(String pid) {
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    /**
	     * Get sDef
	     * 
	     */
	    public String getSdef() {
		return ((String) _templateAndMatrixParameterValues.get("sDef"));
	    }

	    /**
	     * Set sDef
	     * 
	     */
	    public void setSdef(String sdef) {
		_templateAndMatrixParameterValues.put("sDef", sdef);
	    }

	    public void get()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /*  public void getAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }
	     */
	    public void get(UserCredentials userCreds, String asofdatetime, String format)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		_queryParameterValues.put("asOfDateTime", asofdatetime);
		_queryParameterValues.put("format", format);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(String asofdatetime, String format)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("asOfDateTime", asofdatetime);
		_queryParameterValues.put("format", format);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /*public void getAsvoid(String asofdatetime, String format)
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("asOfDateTime", asofdatetime);
		_queryParameterValues.put("format", format);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	}

	public static class SDefMethod {

	    //private JAXBDispatcher _jaxbDispatcher;
	    private DSDispatcher _dsDispatcher;
	    private UriBuilder _uriBuilder;
	    @SuppressWarnings("unused")
	    private JAXBContext _jc;
	    private HashMap<String, Object> _templateAndMatrixParameterValues;
	    private List<String> matrixParamSet;
	    private DataSource retVal;

	    public void setMatrixParamSet(List<String> matrixParamSet) {
		this.matrixParamSet = matrixParamSet;
	    }

	    public List<String> getMatrixParamSet() {
		return matrixParamSet;
	    }

	    public void setRetVal(DataSource retVal) {
		this.retVal = retVal;
	    }

	    public DataSource getRetVal() {
		return retVal;
	    }

	    /**
	     * Create new instance
	     * 
	     */
	    public SDefMethod(String pid, String sdef, String method)
	    throws JAXBException
	    {
		_dsDispatcher = new DSDispatcher();
		_uriBuilder = new UriBuilder();
		String basePath;
		try {
		    basePath = JFig.getInstance().getValue("fedoraServer", "restService");
		} catch (JFigException e) {
		    log.fatal(e.getMessage());
		    //Error, use default Fedora path
		    basePath = "http://localhost:8080/fedora";
		}
		matrixParamSet = _uriBuilder.addPathSegment(basePath);
		matrixParamSet = _uriBuilder.addPathSegment("/{pid}/methods");
		matrixParamSet = _uriBuilder.addPathSegment("/{sDef}/{method}");
		_templateAndMatrixParameterValues = new HashMap<String, Object>();
		_templateAndMatrixParameterValues.put("pid", pid);
		_templateAndMatrixParameterValues.put("sDef", sdef);
		_templateAndMatrixParameterValues.put("method", method);
	    }

	    /**
	     * Get pid
	     * 
	     */
	    public String getPid() {
		return ((String) _templateAndMatrixParameterValues.get("pid"));
	    }

	    /**
	     * Set pid
	     * 
	     */
	    public void setPid(String pid) {
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    /**
	     * Get sDef
	     * 
	     */
	    public String getSdef() {
		return ((String) _templateAndMatrixParameterValues.get("sDef"));
	    }

	    /**
	     * Set sDef
	     * 
	     */
	    public void setSdef(String sdef) {
		_templateAndMatrixParameterValues.put("sDef", sdef);
	    }

	    /**
	     * Get method
	     * 
	     */
	    public String getMethod() {
		return ((String) _templateAndMatrixParameterValues.get("method"));
	    }

	    /**
	     * Set method
	     * 
	     */
	    public void setMethod(String method) {
		_templateAndMatrixParameterValues.put("method", method);
	    }

	    public void get()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /*public void getAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void get(String asofdatetime)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("asOfDateTime", asofdatetime);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    public void get(UserCredentials userCreds, String asofdatetime)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		_queryParameterValues.put("asOfDateTime", asofdatetime);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
		return ;
	    }

	    /*public void getAsvoid(String asofdatetime)
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("asOfDateTime", asofdatetime);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	}

    }

    public static class PidRelationships {

	//private JAXBDispatcher _jaxbDispatcher;
	private DSDispatcher _dsDispatcher;
	private UriBuilder _uriBuilder;
	@SuppressWarnings("unused")
	private JAXBContext _jc;
	private HashMap<String, Object> _templateAndMatrixParameterValues;
	private List<String> matrixParamSet;
	private DataSource retVal;
	private static Logger log = Logger.getLogger(PidRelationships.class);

	public void setMatrixParamSet(List<String> matrixParamSet) {
	    this.matrixParamSet = matrixParamSet;
	}

	public List<String> getMatrixParamSet() {
	    return matrixParamSet;
	}

	public void setRetVal(DataSource retVal) {
	    this.retVal = retVal;
	}

	public DataSource getRetVal() {
	    return retVal;
	}

	/**
	 * Create new instance
	 * 
	 */
	public PidRelationships(String pid)
	throws JAXBException
	{
	    _dsDispatcher = new DSDispatcher();
	    _uriBuilder = new UriBuilder();
	    String basePath;
	    try {
		basePath = JFig.getInstance().getValue("fedoraServer", "restService");
	    } catch (JFigException e) {
		log.fatal(e.getMessage());
		//Error, use default Fedora path
		basePath = "http://localhost:8080/fedora";
	    }
	    matrixParamSet = _uriBuilder.addPathSegment(basePath);
	    matrixParamSet = _uriBuilder.addPathSegment("/{pid}/relationships");
	    _templateAndMatrixParameterValues = new HashMap<String, Object>();
	    _templateAndMatrixParameterValues.put("pid", pid);
	}

	/**
	 * Get pid
	 * 
	 */
	public String getPid() {
	    return ((String) _templateAndMatrixParameterValues.get("pid"));
	}

	/**
	 * Set pid
	 * 
	 */
	public void setPid(String pid) {
	    _templateAndMatrixParameterValues.put("pid", pid);
	}

	public void get()
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	public void get(UserCredentials userCreds)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG -Authorization
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void getAsvoid()
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public void get(String subject, String predicate, String format)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("subject", subject);
	    _queryParameterValues.put("predicate", predicate);
	    _queryParameterValues.put("format", format);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	public void get(UserCredentials userCreds, String subject, String predicate, String format)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    _queryParameterValues.put("subject", subject);
	    _queryParameterValues.put("predicate", predicate);
	    _queryParameterValues.put("format", format);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doGET(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void getAsvoid(String subject, String predicate, String format)
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("subject", subject);
	    _queryParameterValues.put("predicate", predicate);
	    _queryParameterValues.put("format", format);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doGET(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public void delete()
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doDELETE(_url, _headerParameterValues, null);
	    return ;
	}

	public void delete(UserCredentials userCreds)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doDELETE(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void deleteAsvoid()
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doDELETE(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public void delete(String subject, String predicate, String object, Boolean isliteral, String datatype)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("subject", subject);
	    _queryParameterValues.put("predicate", predicate);
	    _queryParameterValues.put("object", object);
	    _queryParameterValues.put("isLiteral", isliteral);
	    _queryParameterValues.put("datatype", datatype);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doDELETE(_url, _headerParameterValues, null);
	    return ;
	}

	public void delete(UserCredentials userCreds, String subject, String predicate, String object, Boolean isliteral, String datatype)
	throws IOException, MalformedURLException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    //AMG - Add credentials
	    _headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

	    _queryParameterValues.put("subject", subject);
	    _queryParameterValues.put("predicate", predicate);
	    _queryParameterValues.put("object", object);
	    _queryParameterValues.put("isLiteral", isliteral);
	    _queryParameterValues.put("datatype", datatype);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    retVal = _dsDispatcher.doDELETE(_url, _headerParameterValues, null);
	    return ;
	}

	/*public void deleteAsvoid(String subject, String predicate, String object, Boolean isliteral, String datatype)
	throws IOException, MalformedURLException, JAXBException
	{
	    HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
	    HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
	    _queryParameterValues.put("subject", subject);
	    _queryParameterValues.put("predicate", predicate);
	    _queryParameterValues.put("object", object);
	    _queryParameterValues.put("isLiteral", isliteral);
	    _queryParameterValues.put("datatype", datatype);
	    String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
	    Object _retVal = _jaxbDispatcher.doDELETE(_url, _headerParameterValues, null);
	    if (_retVal == null) {
		return ;
	    }
	    if (JAXBElement.class.isInstance(_retVal)) {
		JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		_retVal = jaxbElement.getValue();
	    }
	    return ;
	}*/

	public static class New {

	    //private JAXBDispatcher _jaxbDispatcher;
	    private DSDispatcher _dsDispatcher;
	    private UriBuilder _uriBuilder;
	    @SuppressWarnings("unused")
	    private JAXBContext _jc;
	    private HashMap<String, Object> _templateAndMatrixParameterValues;
	    private List<String> matrixParamSet;
	    private DataSource retVal;

	    public void setMatrixParamSet(List<String> matrixParamSet) {
		this.matrixParamSet = matrixParamSet;
	    }

	    public List<String> getMatrixParamSet() {
		return matrixParamSet;
	    }

	    public void setRetVal(DataSource retVal) {
		this.retVal = retVal;
	    }

	    public DataSource getRetVal() {
		return retVal;
	    }

	    /**
	     * Create new instance
	     * 
	     */
	    public New(String pid)
	    throws JAXBException
	    {
		_dsDispatcher = new DSDispatcher();
		_uriBuilder = new UriBuilder();
		String basePath;
		try {
		    basePath = JFig.getInstance().getValue("fedoraServer", "restService");
		} catch (JFigException e) {
		    log.fatal(e.getMessage());
		    //Error, use default Fedora path
		    basePath = "http://localhost:8080/fedora";
		}
		matrixParamSet = _uriBuilder.addPathSegment(basePath);
		matrixParamSet = _uriBuilder.addPathSegment("/{pid}/relationships");
		matrixParamSet = _uriBuilder.addPathSegment("/new");
		_templateAndMatrixParameterValues = new HashMap<String, Object>();
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    /**
	     * Get pid
	     * 
	     */
	    public String getPid() {
		return ((String) _templateAndMatrixParameterValues.get("pid"));
	    }

	    /**
	     * Set pid
	     * 
	     */
	    public void setPid(String pid) {
		_templateAndMatrixParameterValues.put("pid", pid);
	    }

	    public void post()
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    public void post(UserCredentials userCreds)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    /* public void postAsvoid()
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }*/

	    public void post(String subject, String predicate, String object, Boolean isliteral, String datatype)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("subject", subject);
		_queryParameterValues.put("predicate", predicate);
		_queryParameterValues.put("object", object);
		_queryParameterValues.put("isLiteral", isliteral);
		_queryParameterValues.put("datatype", datatype);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    public void post(UserCredentials userCreds, String subject, String predicate, String object, Boolean isliteral, String datatype)
	    throws IOException, MalformedURLException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		//AMG - Add credentials
		_headerParameterValues.put("Authorization", userCreds.getEncodedCredentials());

		_queryParameterValues.put("subject", subject);
		_queryParameterValues.put("predicate", predicate);
		_queryParameterValues.put("object", object);
		_queryParameterValues.put("isLiteral", isliteral);
		_queryParameterValues.put("datatype", datatype);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		retVal = _dsDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		return ;
	    }

	    /*public void postAsvoid(String subject, String predicate, String object, Boolean isliteral, String datatype)
	    throws IOException, MalformedURLException, JAXBException
	    {
		HashMap<String, Object> _queryParameterValues = new HashMap<String, Object>();
		HashMap<String, Object> _headerParameterValues = new HashMap<String, Object>();
		_queryParameterValues.put("subject", subject);
		_queryParameterValues.put("predicate", predicate);
		_queryParameterValues.put("object", object);
		_queryParameterValues.put("isLiteral", isliteral);
		_queryParameterValues.put("datatype", datatype);
		String _url = _uriBuilder.buildUri(_templateAndMatrixParameterValues, _queryParameterValues);
		Object _retVal = _jaxbDispatcher.doPOST(null, null, _url, _headerParameterValues, null);
		if (_retVal == null) {
		    return ;
		}
		if (JAXBElement.class.isInstance(_retVal)) {
		    JAXBElement<?> jaxbElement = ((JAXBElement<?>) _retVal);
		    _retVal = jaxbElement.getValue();
		}
		return ;
	    }
	     */
	}

    }

}